package chuangyi.com.org.ViewModel;

import android.content.Context;
import android.databinding.Bindable;
import android.support.annotation.LayoutRes;
import android.view.View;

import com.umeng.socialize.ShareContent;

import chuangyi.com.org.DOMIHome.adapter.BindingListItem;

/**
 * Created by zxh on 16/12/13.
 */
public class ShareItem extends BindingListItem {
    private String title;
    private int icon;
    private int type;
    private ShareModel parent;
    private ShareContent shareData;

    public void setParent(ShareModel parent) {
        this.parent = parent;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public ShareModel getParent() {
        return parent;
    }

    public ShareContent getShareData() {
        return shareData;
    }

    public void setShareData(ShareContent shareData) {
        this.shareData = shareData;
    }

    @Bindable
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Bindable
    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public ShareItem(Context context, @LayoutRes int layoutId){
        super(context, layoutId);
    }

    public void onClickItem(View view){
        parent.onShare(this);
    }
}
